//
//  NBShoppingViewController.m
//  qiFenQi
//
//  Created by 戒了。 on 16/4/14.
//  Copyright © 2016年 xiaomage. All rights reserved.
//

#import "NBShoppingViewController.h"

@interface NBShoppingViewController ()<UISearchBarDelegate>

@property (nonatomic, weak) UISearchBar *searchBar;
@end

@implementation NBShoppingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //设置导航条内容
    [self setupNavBar];
    
}

//设置导航条内容
- (void)setupNavBar
{
    //左边按钮
    UIBarButtonItem *leftButton = [UIBarButtonItem itemWithImage:[UIImage imageNamed:@"tab_category"] highImage:[UIImage imageNamed:@"tab_category_touchdown"] target:self action:@selector(category)];
    
    self.navigationItem.leftBarButtonItem = leftButton;
    
    //右边
    UIBarButtonItem *rightButton = [UIBarButtonItem itemWithImage:[UIImage imageNamed:@"index-qrcode"] highImage:nil target:self action:@selector(scan)];
    self.navigationItem.rightBarButtonItem = rightButton;
    
    //中间
    UISearchBar *searchBar = [[UISearchBar alloc] init];
    searchBar.placeholder = @"iPhone 6S";
    self.navigationItem.titleView = searchBar;

}

- (void)category {
    
    NBLog(@"点击了分类");
}

- (void)scan
{
    NBLog(@"点击了扫描");
}


@end
